package com.sinosoft.lk.core.config;

import com.sinosoft.lk.core.helper.JedisHelper;
import redis.clients.jedis.JedisPoolConfig;

/**
 * @Author 绫小路
 * @Date 2021/3/4
 */
public class SsoServerConfig {

  private String ssoSessionIdName;
  private String serverName;
  private boolean isJson;
  private JedisPoolConfig jedisPoolConfig;
  private int jedisConnectionTimeout;
  private String jedisAddress;

  public String getServerName() {
    return serverName;
  }

  public void setServerName(String serverName) {
    this.serverName = serverName;
  }

  public String getSsoSessionIdName() {
    return ssoSessionIdName;
  }

  public void setSsoSessionIdName(String ssoSessionIdName) {
    this.ssoSessionIdName = ssoSessionIdName;
  }

  public boolean isJson() {
    return isJson;
  }

  public void setJson(boolean json) {
    isJson = json;
  }

  public JedisPoolConfig getJedisPoolConfig() {
    return jedisPoolConfig;
  }

  public void setJedisPoolConfig(JedisPoolConfig jedisPoolConfig) {
    this.jedisPoolConfig = jedisPoolConfig;
  }

  public int getJedisConnectionTimeout() {
    return jedisConnectionTimeout;
  }

  /**
   * @param jedisConnectionTimeout millisecond 毫秒
   */
  public void setJedisConnectionTimeout(int jedisConnectionTimeout) {
    this.jedisConnectionTimeout = jedisConnectionTimeout;
  }

  public String getJedisAddress() {
    return jedisAddress;
  }

  /**
   * see {@link JedisHelper} the address {redis/rediss}://{ip}:{port} or redis://{ip}:{port},redis://{ip}:{port}/{db}   <br>
   * redis://account:123456@127.0.0.1:6379/5  => user=account password=123456 host=127.0.0.1 port=6379 db=5
   * <br>
   * demo: redis://127.0.0.1:6379
   *
   * @param jedisAddress
   */
  public void setJedisAddress(String jedisAddress) {
    this.jedisAddress = jedisAddress;
  }
}
